{% extends "templates/base.html" %}

{% block csslink %}
		{{ super() }}
		<style type="text/css" title="currentStyle">
			@import "/media/css/demo_page.css";
			@import "/media/css/demo_table.css";
		</style>
        <script type="text/javascript" language="javascript" src="/media/js/jquery.js"></script>
        <script type="text/javascript" language="javascript" src="/media/js/jquery.dataTables.js"></script>
		<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('#example').dataTable();
			} );
	    </script>
{% endblock %}

{% block title %} 
	{{ title }}
{% endblock %}

{% block header %}
{{ header }}
{% endblock %}

{% block login%}
{% if show_login %}
{{ super() }}
{% endif %}
{% endblock%}

{% block navigation %}
{% if not show_login %}
{{ super() }}
{% endif %}
{% endblock %}

{% block page_name %}
{{ content_header }}
{% endblock %}

{% block main_content %}
<p>
	{% if app_user.is_syndic_creator == True %}
    <a href="/ams/syndic/create/">Add syndic</a>
	{% endif %}		
	<div id="demo">
	<table cellpadding="0" cellspacing="0" border="0" class="display" id="example" width="100%">
		<thead>
			<tr>
				<th>Syndic</th>
				<th>Created by</th>
				<th>Last changed by</th>
				<th>Last changed date</th>
				<th>&nbsp;</th>
			</tr>
		</thead>
		<tbody>
			{% if syndics %}
			{% for s in syndics %}
			<tr class="{{ loop.cycle('even gradeC', 'odd gradeC') }}">
				<td>{{s.syndic.name}}</td>
				<td>{{s.syndic.creator}}</td>
				<td>{{s.syndic.lastchange_by}}</td>
				<td>{{s.syndic.lastchange_date|datetimeformat}}</td>
				<td><a href="/ams/syndic/{{ s.syndic.key().id() }}/detail/">Detail</a></td>
			</tr>
			{% endfor %}
			{% endif %}
		</tbody>
		<tfoot>
			<tr>
				<th>Syndic</th>
				<th>Created by</th>
				<th>Last changed by</th>
				<th>Last changed</th>
				<th>&nbsp;</th>
			</tr>
		</tfoot>
	</table>
	</div>
</p>
{% endblock %}
